package com.lancoo.znbkxx.teacher.ui.fragment

import android.graphics.Color
import com.github.mikephil.charting.data.BarDataSet
import com.github.mikephil.charting.data.BarEntry

/**
 * @author : Admin
 * @date   : 2020/10/22
 * @desc   :
 */
class MyBarDataSet(val yVals: MutableList<BarEntry>, label: String) : BarDataSet(yVals, label) {
    override fun getEntryIndex(e: BarEntry?): Int {
        return yVals.indexOf(e)
    }

    override fun getColor(index: Int): Int {
        val barEntry = yVals[index]
        val isCommented = barEntry.data as Int
        return mColors[isCommented]
    }
}